package com.daiyang.ioc.controller;


import com.daiyang.ioc.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class UserController1 {
    private UserService userService;
    @Autowired
    public void setUserService(UserService userService) {
      //  userService.say();
        System.out.println("UserService.setUserService方法");
        this.userService = userService;
    }
    @Autowired
    public UserController1 (UserService userService) {
        userService.say();
//        System.out.println("UserController1.构造方法");
//        this.userService = userService;
    }


    public void say() {
        System.out.println("UserController1.say");
        userService.say();
    }

}
